% option explicit %> <% dim Scriptpath, Scriptname 'dim Family, Genus, Species, Common, Wildcard dim strAccGenus dim blnNoShow dim Criteria, Prefix dim MySQL dim RS, RSTemp dim MyFam, MyTaxcd dim strsql dim rsresults dim family, genus, species, taxcd, common, Wildcard dim blnsametaxon %>
Click on taxon for details including: Photos ( * ), Distribution Maps ( + ), Habitats, and other links.
<% Scriptpath="../scripts/" Scriptname="detail.asp" IF Request.ServerVariables("REQUEST_METHOD")="POST" THEN Family = Request.Form("Family") Genus = Request.Form("Genus") Species = Request.Form("Species") Common = Request.Form("Common") Wildcard = Request.Form("Wildcard") END IF IF Request.ServerVariables("REQUEST_METHOD")="GET" THEN Family = Request.QueryString("Family") Genus = Request.QueryString("Genus") Species = Request.QueryString("Species") Common = Request.QueryString("Common") Wildcard = Request.QueryString("Wildcard") END IF ' Capitalize Family and Genus, lowercase Species Family = TRIM(Family) Family = UCASE(LEFT(Family,1)) & LCASE(MID(Family,2)) Genus = TRIM(Genus) Genus = UCASE(LEFT(Genus,1)) & LCASE(MID(Genus,2)) Species = LCASE(TRIM(Species)) Common = UCASE(TRIM(Common)) ' Take care of single quotes Family = replace(Family,"'","") Genus = REPLACE(Genus,"'","") Species = REPLACE(Species,"'","") Common = REPLACE(Common,"'","''") ' Assemble criteria string for SQL Criteria = "" Prefix = " WHERE" IF Wildcard <> "" THEN IF Family <> "" THEN Criteria = Criteria & Prefix & " (Family LIKE '" & Family & "%') " Prefix = " AND" END IF IF Genus <> "" THEN Criteria = Criteria & Prefix & " (Genus LIKE '" & Genus & "%') " Prefix = " AND" END IF IF Species <> "" THEN Criteria = Criteria & Prefix & " (Species LIKE '" & Species & "%') " Prefix = " AND" END IF ELSE IF Family <> "" THEN Criteria = Criteria & Prefix & " (Family = '" & Family & "') " Prefix = " AND" END IF IF Genus <> "" THEN Criteria = Criteria & Prefix & " (Genus = '" & Genus & "') " Prefix = " AND" END IF IF Species <> "" THEN Criteria = Criteria & Prefix & " (Species = '" & Species & "') " Prefix = " AND" END IF END IF IF Common <> "" THEN Criteria = Criteria & Prefix & " ( Common LIKE '%" & Common & "%') " END IF 'Criteria = Criteria & "AND (Wisc_Found = 'W')" IF Criteria <> "" THEN strsql = "SELECT taxcd, syncd, genus, family, species, common, status_code, photo, thumbmaps, hand, Wisc_Found " _ & "FROM spdetail " _ & "WHERE Taxcd IN ( " _ & "SELECT DISTINCT Taxcd FROM spdetail " & Criteria _ & ") ORDER BY Family, Taxcd, Syncd" 'response.write strsql if retrieveRS(rsresults, strsql, interrornum, strerrormsg) then call ffWriteODBCError(strsql) 'response.write MySQL & "